import { getCateListAPI } from '@/api/cate'

export default {
  namespaced: true,
  state () {
    return {
      list: [] // 分类列表
    }
  },
  mutations: {
    // 设置分类列表
    setCateList (state, payload) {
      state.list = payload
    }
  },
  actions: {
    // 获取分类列表
    async asyncgetCateList (context) {
      const res = await getCateListAPI()
      console.log(res)
      context.commit('setCateList', res.result)
    }
  },
  getters: {

  }
}
